package cn.bugstack.springframework.beans;

import java.util.ArrayList;
import java.util.List;

/**
 * @param
 * @author oyz
 * @version 1.0
 * @description: 类的属性值集合
 * @date 2022/7/19 16:53
 */
public class PropertyValues {

    private List<PropertyValue> propertyValueList = new ArrayList<PropertyValue>();


    public void addPropertyValue(PropertyValue value) {
        this.propertyValueList.add(value);
    }


    public PropertyValue[] getPropertyValues() {
        return propertyValueList.toArray(new PropertyValue[0]);

    }


    public PropertyValue getPropertyValue(String propertyName) {
        for (PropertyValue propertyValue : propertyValueList) {
            if(propertyValue.getPropertyName().equals(propertyName)){
                return propertyValue;
            }
        }
        return null;
    }





}
